#!/bin/bash

if [[ $# -ge 1 && $1 == 'clean' ]]; then
  echo "Cleaning"

  rm -rf autom4te.cache
  rm aclocal.m4
  rm config.h.in
  rm configure
  rm depcomp
  rm install-sh
  rm missing
  find . -type f -name 'Makefile' -exec rm '{}' \;
  find . -type f -name 'Makefile.in' -exec rm '{}' \;
  
  exit 0
fi

rm -rf autom4te.cache
aclocal -I m4
autoconf
autoheader
automake -ac

